package com.bear.cli.command;

import cn.hutool.core.io.FileUtil;
import picocli.CommandLine.*;

import java.io.File;
import java.util.List;

/**
 * @Author : bear
 * Description :
 * @Create : 2024/11/12 - 19:34
 */
@Command(name = "list",description = "查看文件列表",mixinStandardHelpOptions = true)
public class ListCommand implements Runnable{
    @Override
    public void run() {
        String projectPath = System.getProperty("user.dir");
//        System.out.println(projectPath);
        //整个项目的跟路径
        File parentFile = new File(projectPath).getParentFile();
//        System.out.println(parentFile);
        //输入路径
        String inputPath = new File(parentFile, "bear-generator-demo-projects/acm-template").getAbsolutePath();
        List<File> files = FileUtil.loopFiles(inputPath);
        for (File file : files) {
            System.out.println(file);
        }
    }
}
